<template>
	<view>
		<view class="content">
			首页1
		</view>
		<u-tabbar
			:value="value1"
			@change="change1"
			:fixed="true"
			:placeholder="false"
			:safeAreaInsetBottom="false"
		>
			<u-tabbar-item text="首页" icon="home" ></u-tabbar-item>
			<u-tabbar-item text="联系人" icon="list" ></u-tabbar-item>
			<u-tabbar-item text="薇聊" icon="more-circle"  badge="9"></u-tabbar-item>
			<u-tabbar-item text="我" icon="account" dot ></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value1: 0,
			}
		},
		methods: {
			change1(tab_num) {
				// if (tab_num === 1 || tab_num === 2) return uni.$u.toast('请您先登录')
				// else this.value1 = tab_num
				console.log(tab_num);
				if(tab_num === 0){
					uni.redirectTo({
					    url: '/pages/index/index'
					});
				}
				if(tab_num === 1){
					uni.redirectTo({
					    url: '/pages/contact/contact'
					});
				}
				if(tab_num === 2){
					uni.redirectTo({
					    url: '/pages/sheChat/sheChat'
					});
				}
				if(tab_num === 3){
					uni.redirectTo({
					    url: '/pages/user/user'
					});
				}
				this.value1 = tab_num
			},
		}
	}
</script>

<style>

</style>
